@import "variables";
@import "content";

kite-signature {
  display: block;
  padding: @half-padding;
  background: @app-background-color;
  font-family: @font-family;
  max-width: 30em;
  min-width: 20em;

  .kite-content;

  .type-separator {
    color: @text-color-subtle;
    padding: 0 0.1em;
  }

  h4 {
    font-size: 0.9em;
    margin: 10px 0 2px;

    .popular-patterns-toggle, .kwargs-toggle {
      font-size: 1.0em;
      font-weight: 700;
      padding: 0 5px;
      color: @text-color;
      vertical-align: top;
    }
  }

  .kite-signature-wrapper {
    margin: 0;

    kite-links {
      a {
        flex: none;
      }
    }
  }

  pre, code {
    padding: 0;
    background: transparent;
    cursor: default;
    padding-left: 2ch;
    text-indent: -2ch;
    font-size: 0.9em;

    -webkit-user-select: text;
    cursor: text;

    word-wrap: normal;
    word-break: break-word;
    white-space: pre-wrap;

    .line {
      white-space: pre-wrap;
      word-break: break-word;
    }
  }

  .return-type {
    color: @syntax-color-value;
  }

  .parameter.ellipsis {
    color: @text-color-subtle;
  }

  .parameter-name {
    color: @text-color;
  }

  .parameter-highlight .parameter-name {
    padding: 0 3px;
    border-radius: 2px;
    display: inline-block;
    text-indent: 0;

    background: @background-color-highlight;
    color: @text-color-highlight !important;
  }

  .parameter-highlight a .parameter-name,
  a .parameter-name{
    color: @text-color-info;
  }

  &[no-documentation] + .suggestion-description {
    display: none !important;
  }

  section.kwargs {
    display: none;
    margin-bottom: 0;

    kite-links {
      text-align: left;
      margin: 0; // Overrides -1em; maybe not the right place to use kite-links?
    }

    h4 .title:hover {
      color: @text-color;
      cursor: pointer;
    }

    code {
      padding: 0;

      a {
        padding: 0 0.3em;
      }
    }

    dl {
      overflow-y: auto;
      max-height: 200px;
      margin-top: 0;
    }

    dt {
      font-size: 1em;

      code {
        * {
          font-size: inherit;
        }
      }

      & + dt {
        margin-top: 0;
      }

      &.highlight .parameter-name {
        color: @text-color-highlight;
      }

      &.split-line {
        line-height: 0.8em;
      }
    }
  }

  section.kwargs.visible {
    display: block;
  }

  section.patterns {
    display: none;
    margin-bottom: 0;

    &.visible {
      display: block !important;
    }

    h4 .title:hover {
      color: @text-color;
      cursor: pointer;
    }
  }

  h4 {
    cursor: default;
  }

  .kite-pro-features {
    font-size: 0.9em;
    color: @text-color-subtle;
    a {
      color: inherit;
    }
  }

  a.parameter-type {
    display: contents;
  }
}

atom-text-editor kite-signature {
  display: none;
}

atom-text-editor[data-grammar="source python"] kite-signature {
  display: block;
}
